package org.zfes.snowier.cloud.zbss.pmp.router.service.pm;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.zfes.snowier.auth.shiro.util.SecurityUtil;
import org.zfes.snowier.cloud.zbss.pmp.dto.PmpDeduceLineCreateDto;
import org.zfes.snowier.cloud.zbss.pmp.dto.PmpDeduceLineUpdateDto;
import org.zfes.snowier.cloud.zbss.pmp.service.IPmpDeduceLineService;
import org.zfes.snowier.core.data.DataSet;
import org.zfes.snowier.web.controller.BaseController;

@Controller("org.zfes.snowier.cloud.zbss.pmp.router.service.pm.pmpDeduceLineController")
@RequestMapping("/pmp/service/pm/pmpDeduceLine")
public class PmpDeduceLineController extends BaseController {

    @Autowired
    private IPmpDeduceLineService pmpDeduceLineService;

    
  
   
    @RequestMapping(value="/createDeduceLine", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody Object createDeduceLine(PmpDeduceLineCreateDto deduceLineCreateDto){
    	pmpDeduceLineService.createDeduceLine(SecurityUtil.getUserId().get(),deduceLineCreateDto);
        return ajaxDoneSuccess("数据操作成功 ");
    }


    @RequestMapping(value="/updateDeduceLine", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object updateDeduceLine(PmpDeduceLineUpdateDto deduceLineUpdateDto){
    	pmpDeduceLineService.updateDeduceLine(deduceLineUpdateDto);
        return ajaxDoneSuccess("数据操作成功 ");
    }

    //设置状态 #0未开始，1进行中，2结束，3暂停中，-1删除
    @RequestMapping(value="/setDeduceLineStatus", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object setDeduceLineStatus(Long id,Byte status ){
    	pmpDeduceLineService.setPmpDeduceLineStatus(id, status);
        return ajaxDoneSuccess("数据操作成功 ");
    }
    

}
